export default class BusinessModel {
  name: string = ''
  sections: Array<string> | null = null
  clusters: Array<string> | null = null

  constructor(data?: Partial<BusinessModel>) {
    if (data) {
      Object.assign(this, data)
    }
  }

  // 创建新节点的默认值
  static createDefault(): BusinessModel {
    return new BusinessModel({
      name: '',
      sections: null,
      clusters: null,
    })
  }

  // 更新节点数据的方法
  update(updatedData: Partial<BusinessModel>) {
    Object.assign(this, updatedData)
  }

  // 克隆节点的方法
  clone(): BusinessModel {
    return new BusinessModel({ ...this })
  }
}
